﻿@{
ViewBag.Title = "报销单提报";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section mystyle{
<link href="~/Content/css/print.css" rel="stylesheet"/>
}


<div class="w1000" id="print"></div>

<script id="printTable" type="text/html">
  <table class="print table">
    <thead>
    <tr>
      <th colspan="4">
        <img src="/Content/images/logo.png" class="float-left"/>
        <h1>差旅报销单</h1>
      </th>
    </tr>
    </thead>
    <tbody>
    <tr>
      <td>姓名：</td>
      <td>{{data[0].UserName}}</td>
      <td rowspan="3">费用说明/出差目的</td>
      <td rowspan="3"></td>
    </tr>
    <tr>
      <td>项目名称：</td>
      <td>{{data[0].ProjectName}}</td>
    </tr>
    <tr>
      <td>出差地点：</td>
      <td></td>
    </tr>
    <tr>
      <td rowspan="3">出差日期：</td>
      <td rowspan="3">
        <div class="half">
          <label for="start">开始于</label>
          <input type="text" name="start" id="start" value="{{s}}">
        </div>
        <div class="half">
          <label for="end">结束于</label>
          <input type="text" name="end" id="end" value="{{e}}">
        </div>
      </td>
      <td>差旅天数共计</td>
      <td>{{sDays}}</td>
    </tr>
    <tr>
      <td>执行天数共计</td>
      <td>{{eDays}}</td>
    </tr>
    <tr>
      <td>付费性质</td>
      <td>
        <div class="half">

          <label for="company" class="checkbox">
            <input type="radio" name="pay" id="company">
            <span></span>
            <span>公司付费</span>
          </label>
        </div>
        <div class="half">
          <label for="custom" class="checkbox">
            <input type="radio" name="pay" id="custom">
            <span></span>
            <span>客户付费</span>
          </label>
        </div>
      </td>
    </tr>
    <tr>
      <td colspan="4" style="padding: 0;">
        <table class="in-table">
          <tbody>
          <tr>
            <td>费用细项</td>
            {{each keys as key i}}
            <td>{{key.name}}={{key.value}}</td>
            {{/each}}
          </tr>
          <tr>
            <td>小计</td>
            {{each keys as key i}}
            <td>{{key.cost}}</td>
            {{/each}}
          </tr>
          </tbody>
        </table>
      </td>
    </tr>
    <!--<tr>
      <td class="padding-0">
        <div class="half td">费用细项</div>
        <div class="half td">A=住宿费</div>
      </td>
      <td class="padding-0">
        <div class="half td">B=城市间交通费用</div>
        <div class="half td">C=市内交通费</div>
      </td>
      <td>D=差旅包干费</td>
      <td>E=其他费用</td>
    </tr>
    <tr>
      <td class="padding-0">
        <div class="half td">小计</div>
        <div class="half td">894.00</div>
      </td>
      <td class="padding-0">
        <div class="half td"></div>
        <div class="half td padding-0">
          <div class="half td">202.00</div>
          <div class="half td">173.00</div>
        </div>
      </td>
      <td>D=差旅包干费</td>
      <td>E=其他费用</td>
    </tr>-->
    <!--<tr>
      <td class="border-right-0">包干费金额上限：</td>
      <td class="padding-0 border-left-0 border-right-0">
        <div class="half td border-0">D+E+F</div>
        <div class="half td padding-0 border-0">
          <div class="half td border-0"><=</div>
          <div class="half td border-0">420.00</div>
        </div>
      </td>
      <td class="border-left-0 border-right-0"></td>
      <td class="border-left-0"></td>
    </tr>-->
    <tr>
      <td colspan="4">
        <span class="bold">说明：有公式栏目会自动生成数据</span>
      </td>
    </tr>
    <tr>
      <td colspan="4" class="padding-0 bold h70">
        <div class="w25p padding-left-5 padding-right-5">
          <span class="float-left">总裁审批：</span>
        </div>
        <div class="w25p padding-left-5 padding-right-5">
          <span class="float-left">总经理审批：</span>
        </div>
        <div class="w25p padding-left-5 padding-right-5">
          <span class="float-left">财务部审批：</span>
        </div>
        <div class="w25p padding-left-5 padding-right-5">
          <span class="float-left">主管副总审批：</span>
        </div>
      </td>
    </tr>
    <tr>
      <td colspan="4" class="padding-0 bold h70">
        <div class="w25p padding-left-5 padding-right-5">
          <span class="float-left">报销人：</span>
        </div>
        <div class="w25p padding-left-5 padding-right-5">
          <span class="float-left">部门/项目部审批：</span>
        </div>
        <div class="w50p padding-left-5 padding-right-5 relative">
          <ul class="like-table absolute bottom-m1 w75p">
            <li class="clearfix">
              <div class="half padding-5 h32 text-right">应付员工金额小计</div>
              <div class="half padding-5 h32">{{allCost}}</div>
            </li>
            <li class="clearfix">
              <div class="half padding-5 h32 text-right">总计</div>
              <div class="half padding-5 h32">{{allCost}}</div>
            </li>
          </ul>
        </div>
      </td>
    </tr>
    </tbody>
  </table>
  <table class="table margin-top-m1">
    <thead>
    <tr>
      <th>序号</th>
      <th>日期</th>
      <!--<th>费用细项</th>-->
      <th>分类</th>
      <th>费用说明</th>
      <!--<th>币种</th>-->
      <th>金额</th>
      <!--<th>汇率</th>-->
      <!--<th>金额（人民币）</th>-->
      <!--<th>公司已垫付金额</th>-->
    </tr>
    </thead>
    <tbody>
    {{each data as value i}}
    <tr>
      <td>{{i + 1}}</td>
      <td>{{value.ApplyDate}}</td>
      <td>{{value.CostType}}</td>
      <td>{{value.CostExplain}}</td>
      <td>{{value.CostMoney}}</td>
    </tr>
    {{/each}}
    </tbody>
  </table>
  {{if data[0].State == '运营通过'}}
  <div class="text-center margin-top-20">
    <button type="button" id="pass" class="btn btn-success">通过</button>
    <button type="button" id="reject" class="btn btn-danger margin-10">驳回</button>
  </div>
  {{/if}}
</script>

<div class="modal fade" id="rejectReason" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content padding-10 w700">
      <div class="text-right">
        <a class="close-pop" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span></a>
      </div>
      <form class="form-horizontal">
        <div class="form-group">
          <label for="" class="col-sm-3 control-label">驳回理由</label>
          <div class="col-sm-7 line-height-34">
            <textarea name="" id="rejectDetail" class="form-control"></textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-3 col-sm-offset-3">
            <button type="button" id="rejectConfirm" class="btn btn-danger btn-block">驳回</button>
          </div>
          <div class="col-sm-3">
            <button type="button" id="returnReject" class="btn btn-primary btn-block">返回</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

@section myscript{
<script src="~/Content/js/print2.js"></script>
}